package com.inight.nightojbackendserviceclient.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import nightojbackendmodel.dto.question.QuestionQueryRequest;
import nightojbackendmodel.entity.Question;
import nightojbackendmodel.entity.QuestionSubmit;
import nightojbackendmodel.vo.QuestionVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


import javax.servlet.http.HttpServletRequest;

/**
* @author EDY
* @description 针对表【question(题目)】的数据库操作Service
* @createDate 2024-08-16 17:02:47
*/
@FeignClient(name = "nightoj-backend-question-service", path = "/api/question/inner")
public interface QuestionFeignClient{


    /**
     * 根据题目id 获取题目
     * @param questionId
     * @return
     */
    @GetMapping("/get/id")
    Question getQuestionById(@RequestParam("questionId") long questionId);


    /**
     *  根据id 获取用户提交信息
     * @param questionSubmitId
     * @return
     */
    @GetMapping("/get/id")
    QuestionSubmit getQuestionSubmitById(@RequestParam("questionSubmitId") long questionSubmitId);


    /**
     * 更新修改
     * @param questionSubmit
     * @return
     */
    @PostMapping("/question_submit/update")
    boolean updateQuestionSubmitById(@RequestBody QuestionSubmit questionSubmit);


//    /**
//     * 校验
//     *
//     * @param question
//     * @param add
//     */
//    void validQuestion(Question question, boolean add);
//
//    /**
//     * 获取查询条件
//     *
//     * @param questionQueryRequest
//     * @return
//     */
//    QueryWrapper<Question> getQueryWrapper(QuestionQueryRequest questionQueryRequest);
//
//
//    /**
//     * 获取题目封装
//     *
//     * @param question
//     * @param request
//     * @return
//     */
//    QuestionVO getQuestionVO(Question question, HttpServletRequest request);
//
//    /**
//     * 分页获取题目封装
//     *
//     * @param questionPage
//     * @param request
//     * @return
//     */
//    Page<QuestionVO> getQuestionVOPage(Page<Question>questionPage, HttpServletRequest request);

}
